
import GameStartup from "./GameStartup"; 
import VMLayaInit from "../LayaExtends/MVVM/VMLayaInit";
import HttpHelper from "../LayaExtends/Network/HttpHelper";
import SceneManager from "../LayaExtends/SceneManager";
import EventHandler from "../LayaExtends/Utils/EventHandler";
import GameWorldConfig from "../ADCore/Config/GameWorldConfig";
import GameEnvironment from "../LayaExtends/Utils/GameEnvironment";
import SoundManager from "../LayaExtends/Utils/SoundManager";
import ScreenAdaptive from "../LayaExtends/Utils/ScreenAdaptive";
import LocalStorage from "../LayaExtends/Utils/LocalStorage"; 
import { IADQContaniner, IRegisterMoudle } from "../ADCore/Interfaces/IIOC";
/**注册自定义容器实例 */
export default class IOCMoudule implements IRegisterMoudle {

    Load(container: IADQContaniner): void {

        new VMLayaInit().Load(container);
        container.Register("IGameStartup", GameStartup).SingleInstance();
        container.Register("IHttpHelper", HttpHelper);
        container.Register("ISceneManager", SceneManager).SingleInstance();

        container.Register("IEventHandler", EventHandler);

        container.Register("ISoundManager", SoundManager);
        container.Register("IGameEnvironment", GameEnvironment).SingleInstance();
        container.Register("IScreenAdaptive", ScreenAdaptive).SingleInstance();
        container.Register("ILocalStorage",LocalStorage).SingleInstance(); 
        
        GameWorldConfig.initialize(Laya.stage.width, Laya.stage.height, Laya.Browser.width, Laya.Browser.height);
        Laya.stage.width = GameWorldConfig.worldWidth;
        Laya.stage.height = GameWorldConfig.worldHeight;
    }
} 